/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * BuscarCaso.java
 *
 * Created on 09-ene-2013, 16:12:43
 */
package gui;

import com.sun.awt.AWTUtilities;
import controladores.ControladorPrincipal;
import io.Calle;
import io.Caso;
import io.Operador;
import io.TipoMotivo;
import io.TipoSexo;
import io.TipoSustancia;
import io.TipoZona;
import java.awt.Image;
import java.awt.Shape;
import java.awt.geom.RoundRectangle2D;
import java.text.SimpleDateFormat;
import java.util.Iterator;
import java.util.List;
import javax.swing.DefaultComboBoxModel;
import javax.swing.ImageIcon;
import javax.swing.table.DefaultTableModel;
import utilidades.JFrameConFondo;

/**
 *
 * @author NiCo
 */
public class BuscarCaso extends JFrameConFondo {

    private final JFrameConFondo donde;
    private final String quien;
    private Image icono = new ImageIcon(getClass().getResource("/imagenes/logo.png")).getImage();

    /** Creates new form BuscarCaso */
    public BuscarCaso(JFrameConFondo donde, String quien) {
        initComponents();
        setImagen("/imagenes/fondo.png");
        pnl1.setVisible(false);
        pnl2.setVisible(false);
        pnl4.setVisible(false);
        pnl3.setVisible(false);
        pnl5.setVisible(false);
        this.donde = donde;
        this.quien = quien;
        cboOperador.setModel(new DefaultComboBoxModel(ControladorPrincipal.getInstance().getControladorPersonas().listaOperadores().toArray()));
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        buttonGroup3 = new javax.swing.ButtonGroup();
        buttonGroup4 = new javax.swing.ButtonGroup();
        buttonGroup5 = new javax.swing.ButtonGroup();
        btnCerrar = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        cboTipoBusqueda = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        btnSeleccionar = new javax.swing.JButton();
        btnBuscar = new javax.swing.JButton();
        jLayeredPane1 = new javax.swing.JLayeredPane();
        pnl1 = new javax.swing.JPanel();
        txtDni = new javax.swing.JTextField();
        cboSexo = new javax.swing.JComboBox();
        txtNombre = new javax.swing.JTextField();
        txtApellido = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        txtEdad = new javax.swing.JSpinner();
        rbtnNombre = new javax.swing.JRadioButton();
        rbtnDni = new javax.swing.JRadioButton();
        rbtnSexo = new javax.swing.JRadioButton();
        rbtnEdad = new javax.swing.JRadioButton();
        pnl2 = new javax.swing.JPanel();
        jLabel22 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        txtDpto = new javax.swing.JTextField();
        txtPiso = new javax.swing.JTextField();
        txtNroCalle = new javax.swing.JTextField();
        cboCalle = new javax.swing.JComboBox();
        cboZona = new javax.swing.JComboBox();
        rbtnCalle = new javax.swing.JRadioButton();
        rbtnZona = new javax.swing.JRadioButton();
        pnl4 = new javax.swing.JPanel();
        cboOperador = new javax.swing.JComboBox();
        cboMotivo = new javax.swing.JComboBox();
        rbtnOperadora = new javax.swing.JRadioButton();
        rbtnMotivo = new javax.swing.JRadioButton();
        rbtnNroCaso = new javax.swing.JRadioButton();
        txtCaso = new javax.swing.JTextField();
        pnl3 = new javax.swing.JPanel();
        dtpFecha1 = new com.toedter.calendar.JDateChooser();
        rbtnFecha = new javax.swing.JRadioButton();
        rbtnPeriodo = new javax.swing.JRadioButton();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        dtpFecha2 = new com.toedter.calendar.JDateChooser();
        dtpFecha3 = new com.toedter.calendar.JDateChooser();
        pnl5 = new javax.swing.JPanel();
        cboSustancia = new javax.swing.JComboBox();
        cboViolencia = new javax.swing.JComboBox();
        cboAbordaje = new javax.swing.JComboBox();
        rbtnAbordaje = new javax.swing.JRadioButton();
        rbtnSustancia = new javax.swing.JRadioButton();
        rbtnViolencia = new javax.swing.JRadioButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        btnCerrar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cerrar-normal.png"))); // NOI18N
        btnCerrar.setBorder(null);
        btnCerrar.setBorderPainted(false);
        btnCerrar.setFocusPainted(false);
        btnCerrar.setName("btnCerrar"); // NOI18N
        btnCerrar.setOpaque(false);
        btnCerrar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                btnCerrarMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                btnCerrarMouseExited(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                btnCerrarMousePressed(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                btnCerrarMouseReleased(evt);
            }
        });
        btnCerrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCerrarActionPerformed(evt);
            }
        });

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jTable1.setFont(new java.awt.Font("Tahoma", 0, 12));
        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Nro. caso", "Fecha", "Motivo", "Niño / Adolescente", "Operadora"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTable1.setName("jTable1"); // NOI18N
        jScrollPane1.setViewportView(jTable1);

        cboTipoBusqueda.setFont(new java.awt.Font("Tahoma", 0, 12));
        cboTipoBusqueda.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Datos personales", "Ubicación geográfica", "Fecha", "Datos del caso", "Otros" }));
        cboTipoBusqueda.setSelectedIndex(-1);
        cboTipoBusqueda.setName("cboTipoBusqueda"); // NOI18N
        cboTipoBusqueda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cboTipoBusquedaActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel1.setText("Seleccione un método de busqueda");
        jLabel1.setName("jLabel1"); // NOI18N

        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/titulo-buscar-caso.png"))); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        btnSeleccionar.setFont(new java.awt.Font("Tahoma", 0, 12));
        btnSeleccionar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/seleccionar.png"))); // NOI18N
        btnSeleccionar.setBorderPainted(false);
        btnSeleccionar.setFocusPainted(false);
        btnSeleccionar.setName("btnSeleccionar"); // NOI18N
        btnSeleccionar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSeleccionarActionPerformed(evt);
            }
        });

        btnBuscar.setFont(new java.awt.Font("Tahoma", 0, 12));
        btnBuscar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/buscar.png"))); // NOI18N
        btnBuscar.setBorderPainted(false);
        btnBuscar.setFocusPainted(false);
        btnBuscar.setName("btnBuscar"); // NOI18N
        btnBuscar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBuscarActionPerformed(evt);
            }
        });

        jLayeredPane1.setName("jLayeredPane1"); // NOI18N

        pnl1.setName("pnl1"); // NOI18N

        txtDni.setFont(new java.awt.Font("Tahoma 12", 0, 12));
        txtDni.setEnabled(false);
        txtDni.setName("txtDni"); // NOI18N

        cboSexo.setFont(new java.awt.Font("Tahoma 12", 0, 12));
        cboSexo.setModel(new DefaultComboBoxModel(TipoSexo.values()));
        cboSexo.setEnabled(false);
        cboSexo.setName("cboSexo"); // NOI18N

        txtNombre.setFont(new java.awt.Font("Tahoma 12", 0, 12));
        txtNombre.setEnabled(false);
        txtNombre.setName("txtNombre"); // NOI18N

        txtApellido.setFont(new java.awt.Font("Tahoma 12", 0, 12));
        txtApellido.setEnabled(false);
        txtApellido.setName("txtApellido"); // NOI18N

        jLabel12.setFont(new java.awt.Font("Tahoma 12", 1, 12));
        jLabel12.setText("Apellido");
        jLabel12.setName("jLabel12"); // NOI18N

        txtEdad.setFont(new java.awt.Font("Tahoma 12", 0, 12));
        txtEdad.setEnabled(false);
        txtEdad.setName("txtEdad"); // NOI18N

        buttonGroup1.add(rbtnNombre);
        rbtnNombre.setFont(new java.awt.Font("Tahoma 12", 1, 12));
        rbtnNombre.setText("Nombre");
        rbtnNombre.setName("rbtnNombre"); // NOI18N
        rbtnNombre.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbtnNombreActionPerformed(evt);
            }
        });

        buttonGroup1.add(rbtnDni);
        rbtnDni.setFont(new java.awt.Font("Tahoma 12", 1, 12));
        rbtnDni.setText("DNI");
        rbtnDni.setName("rbtnDni"); // NOI18N
        rbtnDni.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbtnDniActionPerformed(evt);
            }
        });

        buttonGroup1.add(rbtnSexo);
        rbtnSexo.setFont(new java.awt.Font("Tahoma 12", 1, 12));
        rbtnSexo.setText("Sexo");
        rbtnSexo.setName("rbtnSexo"); // NOI18N
        rbtnSexo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbtnSexoActionPerformed(evt);
            }
        });

        buttonGroup1.add(rbtnEdad);
        rbtnEdad.setFont(new java.awt.Font("Tahoma 12", 1, 12));
        rbtnEdad.setText("Edad");
        rbtnEdad.setName("rbtnEdad"); // NOI18N
        rbtnEdad.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbtnEdadActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnl1Layout = new javax.swing.GroupLayout(pnl1);
        pnl1.setLayout(pnl1Layout);
        pnl1Layout.setHorizontalGroup(
            pnl1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnl1Layout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addGroup(pnl1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnl1Layout.createSequentialGroup()
                        .addComponent(rbtnNombre)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(28, 28, 28)
                        .addComponent(jLabel12)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtApellido, javax.swing.GroupLayout.PREFERRED_SIZE, 152, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(pnl1Layout.createSequentialGroup()
                        .addComponent(rbtnSexo)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(cboSexo, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(96, 96, 96)
                        .addComponent(rbtnEdad)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtEdad, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(pnl1Layout.createSequentialGroup()
                        .addComponent(rbtnDni)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtDni, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(32, Short.MAX_VALUE))
        );
        pnl1Layout.setVerticalGroup(
            pnl1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnl1Layout.createSequentialGroup()
                .addGroup(pnl1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel12)
                    .addComponent(txtApellido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(rbtnNombre))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnl1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rbtnDni)
                    .addComponent(txtDni, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnl1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rbtnSexo)
                    .addComponent(cboSexo, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtEdad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(rbtnEdad))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pnl1.setBounds(0, 0, 524, 100);
        jLayeredPane1.add(pnl1, javax.swing.JLayeredPane.DEFAULT_LAYER);

        pnl2.setName("pnl2"); // NOI18N

        jLabel22.setFont(new java.awt.Font("Tahoma 12", 1, 12));
        jLabel22.setText("Piso");
        jLabel22.setName("jLabel22"); // NOI18N

        jLabel23.setFont(new java.awt.Font("Tahoma 12", 1, 12));
        jLabel23.setText("Dpto.");
        jLabel23.setName("jLabel23"); // NOI18N

        jLabel21.setFont(new java.awt.Font("Tahoma 12", 1, 12));
        jLabel21.setText("Nro.");
        jLabel21.setName("jLabel21"); // NOI18N

        txtDpto.setFont(new java.awt.Font("Tahoma 12", 0, 12));
        txtDpto.setEnabled(false);
        txtDpto.setName("txtDpto"); // NOI18N

        txtPiso.setFont(new java.awt.Font("Tahoma 12", 0, 12));
        txtPiso.setEnabled(false);
        txtPiso.setName("txtPiso"); // NOI18N

        txtNroCalle.setFont(new java.awt.Font("Tahoma 12", 0, 12));
        txtNroCalle.setEnabled(false);
        txtNroCalle.setName("txtNroCalle"); // NOI18N

        cboCalle.setFont(new java.awt.Font("Tahoma 12", 0, 12));
        cboCalle.setEnabled(false);
        cboCalle.setName("cboCalle"); // NOI18N

        cboZona.setFont(new java.awt.Font("Tahoma 12", 0, 12));
        cboZona.setModel(new DefaultComboBoxModel(TipoZona.values()));
        cboZona.setEnabled(false);
        cboZona.setName("cboZona"); // NOI18N

        buttonGroup2.add(rbtnCalle);
        rbtnCalle.setFont(new java.awt.Font("Tahoma 12", 1, 12));
        rbtnCalle.setText("Calle");
        rbtnCalle.setName("rbtnCalle"); // NOI18N
        rbtnCalle.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbtnCalleActionPerformed(evt);
            }
        });

        buttonGroup2.add(rbtnZona);
        rbtnZona.setFont(new java.awt.Font("Tahoma 12", 1, 12));
        rbtnZona.setText("Zona");
        rbtnZona.setName("rbtnZona"); // NOI18N
        rbtnZona.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbtnZonaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnl2Layout = new javax.swing.GroupLayout(pnl2);
        pnl2.setLayout(pnl2Layout);
        pnl2Layout.setHorizontalGroup(
            pnl2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnl2Layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addGroup(pnl2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnl2Layout.createSequentialGroup()
                        .addComponent(rbtnCalle)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(cboCalle, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel21)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtNroCalle, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 72, Short.MAX_VALUE)
                        .addComponent(rbtnZona)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(cboZona, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(pnl2Layout.createSequentialGroup()
                        .addGap(21, 21, 21)
                        .addComponent(jLabel22)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtPiso, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(10, 10, 10)
                        .addComponent(jLabel23)
                        .addGap(4, 4, 4)
                        .addComponent(txtDpto, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 298, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(26, 26, 26))
        );
        pnl2Layout.setVerticalGroup(
            pnl2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnl2Layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(pnl2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cboCalle, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel21)
                    .addComponent(txtNroCalle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(rbtnCalle)
                    .addComponent(cboZona, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(rbtnZona))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnl2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel22)
                    .addComponent(txtPiso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel23)
                    .addComponent(txtDpto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(26, Short.MAX_VALUE))
        );

        pnl2.setBounds(0, 0, 526, 102);
        jLayeredPane1.add(pnl2, javax.swing.JLayeredPane.DEFAULT_LAYER);

        pnl4.setName("pnl4"); // NOI18N

        cboOperador.setFont(new java.awt.Font("Tahoma 12", 0, 12));
        cboOperador.setEnabled(false);
        cboOperador.setName("cboOperador"); // NOI18N

        cboMotivo.setFont(new java.awt.Font("Tahoma 12", 0, 12));
        cboMotivo.setModel(new DefaultComboBoxModel(TipoMotivo.values()));
        cboMotivo.setEnabled(false);
        cboMotivo.setName("cboMotivo"); // NOI18N

        buttonGroup3.add(rbtnOperadora);
        rbtnOperadora.setFont(new java.awt.Font("Tahoma 12", 1, 12));
        rbtnOperadora.setText("Operadora");
        rbtnOperadora.setName("rbtnOperadora"); // NOI18N
        rbtnOperadora.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbtnOperadoraActionPerformed(evt);
            }
        });

        buttonGroup3.add(rbtnMotivo);
        rbtnMotivo.setFont(new java.awt.Font("Tahoma 12", 1, 12));
        rbtnMotivo.setText("Motivo");
        rbtnMotivo.setName("rbtnMotivo"); // NOI18N
        rbtnMotivo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbtnMotivoActionPerformed(evt);
            }
        });

        buttonGroup3.add(rbtnNroCaso);
        rbtnNroCaso.setFont(new java.awt.Font("Tahoma 12", 1, 12));
        rbtnNroCaso.setText("Nro. de caso");
        rbtnNroCaso.setName("rbtnNroCaso"); // NOI18N
        rbtnNroCaso.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbtnNroCasoActionPerformed(evt);
            }
        });

        txtCaso.setEnabled(false);
        txtCaso.setName("txtCaso"); // NOI18N

        javax.swing.GroupLayout pnl4Layout = new javax.swing.GroupLayout(pnl4);
        pnl4.setLayout(pnl4Layout);
        pnl4Layout.setHorizontalGroup(
            pnl4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnl4Layout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addGroup(pnl4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnl4Layout.createSequentialGroup()
                        .addComponent(rbtnNroCaso)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtCaso, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 98, Short.MAX_VALUE)
                        .addComponent(rbtnMotivo)
                        .addComponent(cboMotivo, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(pnl4Layout.createSequentialGroup()
                        .addGap(129, 129, 129)
                        .addComponent(rbtnOperadora)
                        .addGap(18, 18, 18)
                        .addComponent(cboOperador, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 129, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(19, 19, 19))
        );
        pnl4Layout.setVerticalGroup(
            pnl4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnl4Layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(pnl4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rbtnNroCaso)
                    .addComponent(txtCaso, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(rbtnMotivo)
                    .addComponent(cboMotivo, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnl4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rbtnOperadora)
                    .addComponent(cboOperador, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(24, Short.MAX_VALUE))
        );

        pnl4.setBounds(0, 0, 528, 102);
        jLayeredPane1.add(pnl4, javax.swing.JLayeredPane.DEFAULT_LAYER);

        pnl3.setName("pnl3"); // NOI18N

        dtpFecha1.setDateFormatString("dd/MM/yyyy");
        dtpFecha1.setEnabled(false);
        dtpFecha1.setFont(new java.awt.Font("Tahoma 12", 0, 12));
        dtpFecha1.setName("dtpFecha1"); // NOI18N

        buttonGroup4.add(rbtnFecha);
        rbtnFecha.setFont(new java.awt.Font("Tahoma 12", 1, 12));
        rbtnFecha.setText("Fecha");
        rbtnFecha.setName("rbtnFecha"); // NOI18N
        rbtnFecha.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbtnFechaActionPerformed(evt);
            }
        });

        buttonGroup4.add(rbtnPeriodo);
        rbtnPeriodo.setFont(new java.awt.Font("Tahoma 12", 1, 12));
        rbtnPeriodo.setText("Período de fechas");
        rbtnPeriodo.setName("rbtnPeriodo"); // NOI18N
        rbtnPeriodo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbtnPeriodoActionPerformed(evt);
            }
        });

        jLabel3.setFont(new java.awt.Font("Tahoma 12", 0, 12));
        jLabel3.setText("Desde");
        jLabel3.setName("jLabel3"); // NOI18N

        jLabel4.setFont(new java.awt.Font("Tahoma 12", 0, 12));
        jLabel4.setText("Hasta");
        jLabel4.setName("jLabel4"); // NOI18N

        dtpFecha2.setDateFormatString("dd/MM/yyyy");
        dtpFecha2.setEnabled(false);
        dtpFecha2.setFont(new java.awt.Font("Tahoma 12", 0, 12));
        dtpFecha2.setName("dtpFecha2"); // NOI18N

        dtpFecha3.setDateFormatString("dd/MM/yyyy");
        dtpFecha3.setEnabled(false);
        dtpFecha3.setFont(new java.awt.Font("Tahoma 12", 0, 12));
        dtpFecha3.setName("dtpFecha3"); // NOI18N

        javax.swing.GroupLayout pnl3Layout = new javax.swing.GroupLayout(pnl3);
        pnl3.setLayout(pnl3Layout);
        pnl3Layout.setHorizontalGroup(
            pnl3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnl3Layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(pnl3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnl3Layout.createSequentialGroup()
                        .addComponent(rbtnFecha)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(dtpFecha1, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(pnl3Layout.createSequentialGroup()
                        .addComponent(rbtnPeriodo)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(dtpFecha2, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(32, 32, 32)
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(dtpFecha3, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(25, Short.MAX_VALUE))
        );
        pnl3Layout.setVerticalGroup(
            pnl3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnl3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnl3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(rbtnFecha)
                    .addComponent(dtpFecha1, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(pnl3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(dtpFecha3, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(dtpFecha2, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(pnl3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(rbtnPeriodo)
                        .addComponent(jLabel3)
                        .addComponent(jLabel4)))
                .addContainerGap(25, Short.MAX_VALUE))
        );

        pnl3.setBounds(0, 0, 530, 104);
        jLayeredPane1.add(pnl3, javax.swing.JLayeredPane.DEFAULT_LAYER);

        pnl5.setName("pnl5"); // NOI18N

        cboSustancia.setFont(new java.awt.Font("Tahoma 12", 0, 12));
        cboSustancia.setModel(new DefaultComboBoxModel(TipoSustancia.values()));
        cboSustancia.setEnabled(false);
        cboSustancia.setName("cboSustancia"); // NOI18N

        cboViolencia.setFont(new java.awt.Font("Tahoma 12", 0, 12));
        cboViolencia.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "MALTRATO", "ABANDONO", "ABUSO_SEXUAL", "TESTIGO_VIOLENCIA" }));
        cboViolencia.setSelectedIndex(-1);
        cboViolencia.setEnabled(false);
        cboViolencia.setName("cboViolencia"); // NOI18N

        cboAbordaje.setFont(new java.awt.Font("Tahoma 12", 0, 12));
        cboAbordaje.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "102", "Derivado" }));
        cboAbordaje.setSelectedIndex(-1);
        cboAbordaje.setEnabled(false);
        cboAbordaje.setName("cboAbordaje"); // NOI18N

        buttonGroup5.add(rbtnAbordaje);
        rbtnAbordaje.setFont(new java.awt.Font("Tahoma 12", 1, 12));
        rbtnAbordaje.setText("Tipo de abordaje");
        rbtnAbordaje.setName("rbtnAbordaje"); // NOI18N
        rbtnAbordaje.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbtnAbordajeActionPerformed(evt);
            }
        });

        buttonGroup5.add(rbtnSustancia);
        rbtnSustancia.setFont(new java.awt.Font("Tahoma 12", 1, 12));
        rbtnSustancia.setText("Tipo de sustancia");
        rbtnSustancia.setName("rbtnSustancia"); // NOI18N
        rbtnSustancia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbtnSustanciaActionPerformed(evt);
            }
        });

        buttonGroup5.add(rbtnViolencia);
        rbtnViolencia.setFont(new java.awt.Font("Tahoma 12", 1, 12));
        rbtnViolencia.setText("Tipo de violencia");
        rbtnViolencia.setName("rbtnViolencia"); // NOI18N
        rbtnViolencia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbtnViolenciaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout pnl5Layout = new javax.swing.GroupLayout(pnl5);
        pnl5.setLayout(pnl5Layout);
        pnl5Layout.setHorizontalGroup(
            pnl5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnl5Layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addGroup(pnl5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(pnl5Layout.createSequentialGroup()
                        .addComponent(rbtnSustancia)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(cboSustancia, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(pnl5Layout.createSequentialGroup()
                        .addComponent(rbtnAbordaje)
                        .addGap(8, 8, 8)
                        .addComponent(cboAbordaje, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(pnl5Layout.createSequentialGroup()
                        .addComponent(rbtnViolencia)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(cboViolencia, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap(202, Short.MAX_VALUE))
        );
        pnl5Layout.setVerticalGroup(
            pnl5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnl5Layout.createSequentialGroup()
                .addGroup(pnl5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rbtnAbordaje)
                    .addComponent(cboAbordaje, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(9, 9, 9)
                .addGroup(pnl5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rbtnSustancia)
                    .addComponent(cboSustancia, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnl5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rbtnViolencia, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(cboViolencia, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(12, Short.MAX_VALUE))
        );

        pnl5.setBounds(0, 0, 524, 103);
        jLayeredPane1.add(pnl5, javax.swing.JLayeredPane.DEFAULT_LAYER);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(226, 226, 226)
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 186, Short.MAX_VALUE)
                        .addComponent(btnCerrar))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(cboTipoBusqueda, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 195, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                        .addComponent(btnBuscar, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(2, 2, 2))
                                    .addComponent(btnSeleccionar, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(191, 191, 191))
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 530, Short.MAX_VALUE)
                            .addComponent(jLayeredPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 530, Short.MAX_VALUE))))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btnCerrar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(cboTipoBusqueda, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLayeredPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnBuscar, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(11, 11, 11)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(11, 11, 11)
                .addComponent(btnSeleccionar, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnCerrarMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnCerrarMouseEntered

        btnCerrar.setIcon(new ImageIcon(getClass().getResource("/imagenes/cerrar-activo.png")));     }//GEN-LAST:event_btnCerrarMouseEntered

    private void btnCerrarMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnCerrarMouseExited

        btnCerrar.setIcon(new ImageIcon(getClass().getResource("/imagenes/cerrar-normal.png")));     }//GEN-LAST:event_btnCerrarMouseExited

    private void btnCerrarMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnCerrarMousePressed

        btnCerrar.setIcon(new ImageIcon(getClass().getResource("/imagenes/cerrar-click.png")));     }//GEN-LAST:event_btnCerrarMousePressed

    private void btnCerrarMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnCerrarMouseReleased

        btnCerrar.setIcon(new ImageIcon(getClass().getResource("/imagenes/cerrar-normal.png")));     }//GEN-LAST:event_btnCerrarMouseReleased

    private void btnCerrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCerrarActionPerformed
        this.dispose();
    }//GEN-LAST:event_btnCerrarActionPerformed

    private void cboTipoBusquedaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cboTipoBusquedaActionPerformed
        if (cboTipoBusqueda.getSelectedIndex() == 0) {
            jLayeredPane1.moveToFront(pnl1);
            pnl1.setVisible(true);
            pnl2.setVisible(false);
            pnl4.setVisible(false);
            pnl3.setVisible(false);
            pnl5.setVisible(false);
        } else {
            if (cboTipoBusqueda.getSelectedIndex() == 1) {
                jLayeredPane1.moveToFront(pnl2);
                pnl1.setVisible(false);
                pnl2.setVisible(true);
                pnl4.setVisible(false);
                pnl3.setVisible(false);
                pnl5.setVisible(false);
            } else {
                if (cboTipoBusqueda.getSelectedIndex() == 3) {
                    jLayeredPane1.moveToFront(pnl4);
                    pnl1.setVisible(false);
                    pnl2.setVisible(false);
                    pnl4.setVisible(true);
                    pnl3.setVisible(false);
                    pnl5.setVisible(false);
                } else {
                    if (cboTipoBusqueda.getSelectedIndex() == 2) {
                        jLayeredPane1.moveToFront(pnl3);
                        pnl1.setVisible(false);
                        pnl2.setVisible(false);
                        pnl4.setVisible(false);
                        pnl3.setVisible(true);
                        pnl5.setVisible(false);
                    } else {
                        if (cboTipoBusqueda.getSelectedIndex() == 4) {
                            jLayeredPane1.moveToFront(pnl5);
                            pnl1.setVisible(false);
                            pnl2.setVisible(false);
                            pnl4.setVisible(false);
                            pnl3.setVisible(false);
                            pnl5.setVisible(true);
                        }
                    }
                }
            }
        }
    }//GEN-LAST:event_cboTipoBusquedaActionPerformed

    private void btnBuscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarActionPerformed
        if (cboTipoBusqueda.getSelectedIndex() != -1) {
            List<Caso> casos = null;
            if (cboTipoBusqueda.getSelectedIndex() == 0) {
                if (rbtnNombre.isSelected()) {
                    casos = ControladorPrincipal.getInstance().getControladorCasos().buscarXNombre(txtNombre.getText(), txtApellido.getText());
                } else {
                    if (rbtnEdad.isSelected()) {
                        casos = ControladorPrincipal.getInstance().getControladorCasos().buscarXEdad(Integer.parseInt(txtEdad.getValue().toString()));
                    } else {
                        if (rbtnDni.isSelected()) {
                            if (isNumeric(txtDni.getText())) {
                                casos = ControladorPrincipal.getInstance().getControladorCasos().buscarXDni(Long.parseLong(txtDni.getText()));
                            } else {
                                MensajesInfo p1 = new MensajesInfo('e', "ErrorNumero");
                                p1.setLocationRelativeTo(null);
                                p1.setIconImage(icono);
                                p1.setVisible(true);
                                Shape shape = new RoundRectangle2D.Float(0, 0, p1.getWidth(), p1.getHeight(), 30, 30);
                                AWTUtilities.setWindowShape(p1, shape);
                            }
                        } else {
                            if (rbtnSexo.isSelected()) {
                                if (cboSexo.getSelectedIndex() != -1) {
                                    casos = ControladorPrincipal.getInstance().getControladorCasos().buscarXSexo((TipoSexo) cboSexo.getSelectedItem());
                                } else {
                                    MensajesInfo p1 = new MensajesInfo('e', "CamposVacios");
                                    p1.setLocationRelativeTo(null);
                                    p1.setIconImage(icono);
                                    p1.setVisible(true);
                                    Shape shape = new RoundRectangle2D.Float(0, 0, p1.getWidth(), p1.getHeight(), 30, 30);
                                    AWTUtilities.setWindowShape(p1, shape);
                                }
                            }
                        }
                    }
                }
            } else {
                if (cboTipoBusqueda.getSelectedIndex() == 1) {
                    if (rbtnCalle.isSelected()) {
                        if (cboCalle.getSelectedIndex() != -1 && !txtNroCalle.getText().equals("") && !txtDpto.getText().equals("") && !txtPiso.getText().equals("")) {
                            if (isNumeric(txtNroCalle.getText()) && isNumeric(txtPiso.getText())) {
                                casos = ControladorPrincipal.getInstance().getControladorCasos().buscarXDireccion((Calle) cboCalle.getSelectedItem(), Integer.parseInt(txtNroCalle.getText()), Integer.parseInt(txtPiso.getText()), txtDpto.getText());
                            } else {
                                MensajesInfo p1 = new MensajesInfo('e', "ErrorNumero");
                                p1.setLocationRelativeTo(null);
                                p1.setIconImage(icono);
                                p1.setVisible(true);
                                Shape shape = new RoundRectangle2D.Float(0, 0, p1.getWidth(), p1.getHeight(), 30, 30);
                                AWTUtilities.setWindowShape(p1, shape);
                            }
                        } else {
                            if (cboCalle.getSelectedIndex() != -1 && !txtNroCalle.getText().equals("")) {
                                if (isNumeric(txtNroCalle.getText())) {
                                    casos = ControladorPrincipal.getInstance().getControladorCasos().buscarXDireccion((Calle) cboCalle.getSelectedItem(), Integer.parseInt(txtNroCalle.getText()), -1, "");
                                } else {
                                    MensajesInfo p1 = new MensajesInfo('e', "ErrorNumero");
                                    p1.setLocationRelativeTo(null);
                                    p1.setIconImage(icono);
                                    p1.setVisible(true);
                                    Shape shape = new RoundRectangle2D.Float(0, 0, p1.getWidth(), p1.getHeight(), 30, 30);
                                    AWTUtilities.setWindowShape(p1, shape);
                                }
                            } else {
                                if (!txtDpto.getText().equals("") && !txtPiso.getText().equals("")) {
                                    if (isNumeric(txtPiso.getText())) {
                                        casos = ControladorPrincipal.getInstance().getControladorCasos().buscarXDireccion(null, -1, Integer.parseInt(txtPiso.getText()), txtDpto.getText());
                                    } else {
                                        MensajesInfo p1 = new MensajesInfo('e', "ErrorNumero");
                                        p1.setLocationRelativeTo(null);
                                        p1.setIconImage(icono);
                                        p1.setVisible(true);
                                        Shape shape = new RoundRectangle2D.Float(0, 0, p1.getWidth(), p1.getHeight(), 30, 30);
                                        AWTUtilities.setWindowShape(p1, shape);
                                    }
                                } else {
                                    if (cboCalle.getSelectedIndex() != -1) {
                                        casos = ControladorPrincipal.getInstance().getControladorCasos().buscarXDireccion((Calle) cboCalle.getSelectedItem(), -1, -1, "");
                                    } else {
                                        MensajesInfo p1 = new MensajesInfo('e', "CamposVacios");
                                        p1.setLocationRelativeTo(null);
                                        p1.setIconImage(icono);
                                        p1.setVisible(true);
                                        Shape shape = new RoundRectangle2D.Float(0, 0, p1.getWidth(), p1.getHeight(), 30, 30);
                                        AWTUtilities.setWindowShape(p1, shape);
                                    }
                                }
                            }
                        }
                    } else {
                        if (rbtnZona.isSelected()) {
                            if (cboZona.getSelectedIndex() != -1) {
                                casos = ControladorPrincipal.getInstance().getControladorCasos().buscarXZona((TipoZona) cboZona.getSelectedItem());
                            } else {
                                MensajesInfo p1 = new MensajesInfo('e', "CamposVacios");
                                p1.setLocationRelativeTo(null);
                                p1.setIconImage(icono);
                                p1.setVisible(true);
                                Shape shape = new RoundRectangle2D.Float(0, 0, p1.getWidth(), p1.getHeight(), 30, 30);
                                AWTUtilities.setWindowShape(p1, shape);
                            }
                        }
                    }
                } else {
                    if (cboTipoBusqueda.getSelectedIndex() == 3) {
                        if (rbtnNroCaso.isSelected()) {
                            if (isNumeric(txtCaso.getText())) {
                                casos = ControladorPrincipal.getInstance().getControladorCasos().buscarXNroCaso(Long.valueOf(txtCaso.getText()));
                            } else {
                                MensajesInfo p1 = new MensajesInfo('e', "ErrorNumero");
                                p1.setLocationRelativeTo(null);
                                p1.setIconImage(icono);
                                p1.setVisible(true);
                                Shape shape = new RoundRectangle2D.Float(0, 0, p1.getWidth(), p1.getHeight(), 30, 30);
                                AWTUtilities.setWindowShape(p1, shape);
                            }
                        } else {
                            if (rbtnMotivo.isSelected()) {
                                if (cboMotivo.getSelectedIndex() != -1) {
                                    casos = ControladorPrincipal.getInstance().getControladorCasos().buscarXMotivo((TipoMotivo) cboMotivo.getSelectedItem());
                                } else {
                                    MensajesInfo p1 = new MensajesInfo('e', "CamposVacios");
                                    p1.setLocationRelativeTo(null);
                                    p1.setIconImage(icono);
                                    p1.setVisible(true);
                                    Shape shape = new RoundRectangle2D.Float(0, 0, p1.getWidth(), p1.getHeight(), 30, 30);
                                    AWTUtilities.setWindowShape(p1, shape);
                                }
                            } else {
                                if (rbtnOperadora.isSelected()) {
                                    if (cboOperador.getSelectedIndex() != -1) {
                                        casos = ControladorPrincipal.getInstance().getControladorCasos().buscarXOperador((Operador) cboOperador.getSelectedItem());
                                    } else {
                                        MensajesInfo p1 = new MensajesInfo('e', "CamposVacios");
                                        p1.setLocationRelativeTo(null);
                                        p1.setIconImage(icono);
                                        p1.setVisible(true);
                                        Shape shape = new RoundRectangle2D.Float(0, 0, p1.getWidth(), p1.getHeight(), 30, 30);
                                        AWTUtilities.setWindowShape(p1, shape);
                                    }
                                }
                            }
                        }
                    } else {
                        if (cboTipoBusqueda.getSelectedIndex() == 2) {
                            if (rbtnFecha.isSelected()) {
                                if (dtpFecha1.getDate() != null) {
                                    casos = ControladorPrincipal.getInstance().getControladorCasos().buscarXFecha(dtpFecha1.getDate());
                                } else {
                                    MensajesInfo p1 = new MensajesInfo('e', "CamposVacios");
                                    p1.setLocationRelativeTo(null);
                                    p1.setIconImage(icono);
                                    p1.setVisible(true);
                                    Shape shape = new RoundRectangle2D.Float(0, 0, p1.getWidth(), p1.getHeight(), 30, 30);
                                    AWTUtilities.setWindowShape(p1, shape);
                                }
                            } else {
                                if (rbtnPeriodo.isSelected()) {
                                    if (dtpFecha2.getDate() != null && dtpFecha3.getDate() != null) {
                                        if (dtpFecha2.getDate().before(dtpFecha3.getDate())) {
                                            casos = ControladorPrincipal.getInstance().getControladorCasos().buscarXPeriodo(dtpFecha2.getDate(), dtpFecha3.getDate());
                                        } else {
                                            MensajesInfo p1 = new MensajesInfo('e', "Fechas");
                                            p1.setLocationRelativeTo(null);
                                            p1.setIconImage(icono);
                                            p1.setVisible(true);
                                            Shape shape = new RoundRectangle2D.Float(0, 0, p1.getWidth(), p1.getHeight(), 30, 30);
                                            AWTUtilities.setWindowShape(p1, shape);
                                        }
                                    } else {
                                        MensajesInfo p1 = new MensajesInfo('e', "CamposVacios");
                                        p1.setLocationRelativeTo(null);
                                        p1.setIconImage(icono);
                                        p1.setVisible(true);
                                        Shape shape = new RoundRectangle2D.Float(0, 0, p1.getWidth(), p1.getHeight(), 30, 30);
                                        AWTUtilities.setWindowShape(p1, shape);
                                    }
                                }
                            }
                        } else {
                            if (cboTipoBusqueda.getSelectedIndex() == 4) {
                                if (rbtnAbordaje.isSelected()) {
                                    if (cboAbordaje.getSelectedIndex() != -1) {
                                        casos = ControladorPrincipal.getInstance().getControladorCasos().buscarXAbordaje(cboAbordaje.getSelectedItem().toString());
                                    } else {
                                        MensajesInfo p1 = new MensajesInfo('e', "CamposVacios");
                                        p1.setLocationRelativeTo(null);
                                        p1.setIconImage(icono);
                                        p1.setVisible(true);
                                        Shape shape = new RoundRectangle2D.Float(0, 0, p1.getWidth(), p1.getHeight(), 30, 30);
                                        AWTUtilities.setWindowShape(p1, shape);
                                    }
                                } else {
                                    if (rbtnViolencia.isSelected()) {
                                        if (cboViolencia.getSelectedIndex() != -1) {
                                            casos = ControladorPrincipal.getInstance().getControladorCasos().buscarXViolencia(cboViolencia.getSelectedItem().toString());
                                        } else {
                                            MensajesInfo p1 = new MensajesInfo('e', "CamposVacios");
                                            p1.setLocationRelativeTo(null);
                                            p1.setIconImage(icono);
                                            p1.setVisible(true);
                                            Shape shape = new RoundRectangle2D.Float(0, 0, p1.getWidth(), p1.getHeight(), 30, 30);
                                            AWTUtilities.setWindowShape(p1, shape);
                                        }
                                    } else {
                                        if (rbtnSustancia.isSelected()) {
                                            if (cboSustancia.getSelectedIndex() != -1) {
                                                casos = ControladorPrincipal.getInstance().getControladorCasos().buscarXSustancia((TipoSustancia) cboSustancia.getSelectedItem());
                                            } else {
                                                MensajesInfo p1 = new MensajesInfo('e', "CamposVacios");
                                                p1.setLocationRelativeTo(null);
                                                p1.setIconImage(icono);
                                                p1.setVisible(true);
                                                Shape shape = new RoundRectangle2D.Float(0, 0, p1.getWidth(), p1.getHeight(), 30, 30);
                                                AWTUtilities.setWindowShape(p1, shape);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel();
            int cantidad = modelo.getRowCount();
            for (int i = 0; i < cantidad; i++) {
                modelo.removeRow(0);
            }
            if (casos != null) {
                Iterator<Caso> it = casos.iterator();
                Object[] obj;
                SimpleDateFormat sdf = new java.text.SimpleDateFormat("dd/MM/yyyy");
                while (it.hasNext()) {
                    Caso caso = it.next();
                    obj = new Object[5];
                    obj[0] = caso;
                    obj[1] = sdf.format(caso.getFecha());
                    obj[2] = caso.getMotivo().toString();
                    obj[3] = caso.getNino_adolescente().toString();
                    obj[4] = caso.getOperador().toString();
                    modelo.addRow(obj);
                }
            }
        } else {
            MensajesInfo p1 = new MensajesInfo('e', "SeleccionarBusqueda");
            p1.setLocationRelativeTo(null);
            p1.setIconImage(icono);
            p1.setVisible(true);
            Shape shape = new RoundRectangle2D.Float(0, 0, p1.getWidth(), p1.getHeight(), 30, 30);
            AWTUtilities.setWindowShape(p1, shape);
        }
    }//GEN-LAST:event_btnBuscarActionPerformed

    private void btnSeleccionarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSeleccionarActionPerformed
        Caso caso = (Caso) jTable1.getValueAt(jTable1.getSelectedRow(), 0);
        if (this.quien.equals("mc")) {
            ModificarCaso frm = new ModificarCaso(caso);
            frm.setLocationRelativeTo(null);
            frm.setImagen("/imagenes/fondo.png");
            frm.setIconImage(icono);
            frm.setVisible(true);
            Shape shape = new RoundRectangle2D.Float(0, 0, frm.getWidth(), frm.getHeight(), 30, 30);
            AWTUtilities.setWindowShape(frm, shape);
            this.dispose();
        } else {
            if (this.quien.equals("cc")) {
                ConsultarCaso frm = new ConsultarCaso(caso);
                frm.setLocationRelativeTo(null);
                frm.setImagen("/imagenes/fondo.png");
                frm.setIconImage(icono);
                frm.setVisible(true);
                Shape shape = new RoundRectangle2D.Float(0, 0, frm.getWidth(), frm.getHeight(), 30, 30);
                AWTUtilities.setWindowShape(frm, shape);
                this.dispose();
            } else {
                if (this.quien.equals("na")) {
                    NuevaActualizacion actualizacion = (NuevaActualizacion) this.donde;
                    actualizacion.setCaso(caso);
                    this.dispose();
                } else {
                    if (this.quien.equals("ma")) {
                        if (!caso.getActualizaciones().isEmpty()) {
                            ListaActualizaciones frm = new ListaActualizaciones(caso, 'b');
                            frm.setLocationRelativeTo(null);
                            frm.setImagen("/imagenes/fondo.png");
                            frm.setIconImage(icono);
                            frm.setVisible(true);
                            Shape shape = new RoundRectangle2D.Float(0, 0, frm.getWidth(), frm.getHeight(), 30, 30);
                            AWTUtilities.setWindowShape(frm, shape);
                            this.dispose();
                        } else {
                            MensajesInfo p1 = new MensajesInfo('n', "NoActualizaciones");
                            p1.setLocationRelativeTo(null);
                            p1.setIconImage(icono);
                            p1.setVisible(true);
                            Shape shape = new RoundRectangle2D.Float(0, 0, p1.getWidth(), p1.getHeight(), 30, 30);
                            AWTUtilities.setWindowShape(p1, shape);
                        }
                    } else {
                        if (this.quien.equals("ns")) {
                            NuevoSeguimiento seguimiento = (NuevoSeguimiento) this.donde;
                            seguimiento.setCaso(caso);
                            this.dispose();
                        } else {
                            if (this.quien.equals("ms")) {
                                if (!caso.getSeguimientos().isEmpty()) {
                                    ListaSeguimientos frm = new ListaSeguimientos(caso, 'b');
                                    frm.setLocationRelativeTo(null);
                                    frm.setImagen("/imagenes/fondo.png");
                                    frm.setIconImage(icono);
                                    frm.setVisible(true);
                                    Shape shape = new RoundRectangle2D.Float(0, 0, frm.getWidth(), frm.getHeight(), 30, 30);
                                    AWTUtilities.setWindowShape(frm, shape);
                                    this.dispose();
                                } else {
                                    MensajesInfo p1 = new MensajesInfo('n', "NoSeguimientos");
                                    p1.setLocationRelativeTo(null);
                                    p1.setIconImage(icono);
                                    p1.setVisible(true);
                                    Shape shape = new RoundRectangle2D.Float(0, 0, p1.getWidth(), p1.getHeight(), 30, 30);
                                    AWTUtilities.setWindowShape(p1, shape);
                                }
                            } else {
                                if (this.quien.equals("es")) {
                                    if (!caso.getSeguimientos().isEmpty()) {
                                        ListaSeguimientos frm = new ListaSeguimientos(caso, 'e');
                                        frm.setLocationRelativeTo(null);
                                        frm.setImagen("/imagenes/fondo.png");
                                        frm.setIconImage(icono);
                                        frm.setVisible(true);
                                        Shape shape = new RoundRectangle2D.Float(0, 0, frm.getWidth(), frm.getHeight(), 30, 30);
                                        AWTUtilities.setWindowShape(frm, shape);
                                        this.dispose();
                                    } else {
                                        MensajesInfo p1 = new MensajesInfo('n', "NoSeguimientos");
                                        p1.setLocationRelativeTo(null);
                                        p1.setIconImage(icono);
                                        p1.setVisible(true);
                                        Shape shape = new RoundRectangle2D.Float(0, 0, p1.getWidth(), p1.getHeight(), 30, 30);
                                        AWTUtilities.setWindowShape(p1, shape);
                                    }
                                } else {
                                    if (this.quien.equals("nia")) {
                                        NuevaIntervencion intervencion = (NuevaIntervencion) this.donde;
                                        intervencion.setCasoAdiccion(caso);
                                        this.dispose();
                                    } else {
                                        if (this.quien.equals("niv")) {
                                            NuevaIntervencion intervencion = (NuevaIntervencion) this.donde;
                                            intervencion.setCasoViolencia(caso);
                                            this.dispose();
                                        } else {
                                            if (this.quien.equals("mi")) {
                                                if (!caso.getIntervenciones().isEmpty()) {
                                                    ListaIntervenciones frm = new ListaIntervenciones(caso, 'b');
                                                    frm.setLocationRelativeTo(null);
                                                    frm.setImagen("/imagenes/fondo.png");
                                                    frm.setIconImage(icono);
                                                    frm.setVisible(true);
                                                    Shape shape = new RoundRectangle2D.Float(0, 0, frm.getWidth(), frm.getHeight(), 30, 30);
                                                    AWTUtilities.setWindowShape(frm, shape);
                                                    this.dispose();
                                                } else {
                                                    MensajesInfo p1 = new MensajesInfo('n', "NoIntervenciones");
                                                    p1.setLocationRelativeTo(null);
                                                    p1.setIconImage(icono);
                                                    p1.setVisible(true);
                                                    Shape shape = new RoundRectangle2D.Float(0, 0, p1.getWidth(), p1.getHeight(), 30, 30);
                                                    AWTUtilities.setWindowShape(p1, shape);
                                                }
                                            } else {
                                                if (this.quien.equals("ei")) {
                                                    if (!caso.getIntervenciones().isEmpty()) {
                                                        ListaIntervenciones frm = new ListaIntervenciones(caso, 'e');
                                                        frm.setLocationRelativeTo(null);
                                                        frm.setImagen("/imagenes/fondo.png");
                                                        frm.setIconImage(icono);
                                                        frm.setVisible(true);
                                                        Shape shape = new RoundRectangle2D.Float(0, 0, frm.getWidth(), frm.getHeight(), 30, 30);
                                                        AWTUtilities.setWindowShape(frm, shape);
                                                        this.dispose();
                                                    } else {
                                                        MensajesInfo p1 = new MensajesInfo('n', "NoIntervenciones");
                                                        p1.setLocationRelativeTo(null);
                                                        p1.setIconImage(icono);
                                                        p1.setVisible(true);
                                                        Shape shape = new RoundRectangle2D.Float(0, 0, p1.getWidth(), p1.getHeight(), 30, 30);
                                                        AWTUtilities.setWindowShape(p1, shape);
                                                    }
                                                } else {
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }//GEN-LAST:event_btnSeleccionarActionPerformed

    private void rbtnNombreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbtnNombreActionPerformed
        txtNombre.setEnabled(true);
        txtApellido.setEnabled(true);
        txtDni.setEnabled(false);
        txtEdad.setEnabled(false);
        cboSexo.setEnabled(false);
        cboSexo.setSelectedIndex(-1);
        txtNombre.setText("");
        txtApellido.setText("");
        txtDni.setText("");
        txtEdad.setValue(1);
    }//GEN-LAST:event_rbtnNombreActionPerformed

    private void rbtnDniActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbtnDniActionPerformed
        txtNombre.setEnabled(false);
        txtApellido.setEnabled(false);
        txtDni.setEnabled(true);
        cboSexo.setEnabled(false);
        cboSexo.setSelectedIndex(-1);
        txtEdad.setEnabled(false);
        txtNombre.setText("");
        txtApellido.setText("");
        txtDni.setText("");
        txtEdad.setValue(1);
    }//GEN-LAST:event_rbtnDniActionPerformed

    private void rbtnSexoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbtnSexoActionPerformed
        txtNombre.setEnabled(false);
        txtApellido.setEnabled(false);
        txtDni.setEnabled(false);
        cboSexo.setEnabled(true);
        cboSexo.setSelectedIndex(-1);
        txtEdad.setEnabled(false);
        txtNombre.setText("");
        txtApellido.setText("");
        txtDni.setText("");
        txtEdad.setValue(1);
    }//GEN-LAST:event_rbtnSexoActionPerformed

    private void rbtnEdadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbtnEdadActionPerformed
        txtNombre.setEnabled(false);
        txtApellido.setEnabled(false);
        txtDni.setEnabled(false);
        cboSexo.setEnabled(false);
        cboSexo.setSelectedIndex(-1);
        txtEdad.setEnabled(true);
        txtNombre.setText("");
        txtApellido.setText("");
        txtDni.setText("");
        txtEdad.setValue(1);
    }//GEN-LAST:event_rbtnEdadActionPerformed

    private void rbtnCalleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbtnCalleActionPerformed
        cboCalle.setEnabled(true);
        txtNroCalle.setEnabled(true);
        txtPiso.setEnabled(true);
        txtDpto.setEnabled(true);
        cboZona.setEnabled(false);
        cboCalle.setSelectedIndex(-1);
        cboZona.setSelectedIndex(-1);
        txtNroCalle.setText("");
        txtPiso.setText("");
        txtDpto.setText("");
    }//GEN-LAST:event_rbtnCalleActionPerformed

    private void rbtnZonaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbtnZonaActionPerformed
        cboCalle.setEnabled(false);
        cboCalle.setSelectedIndex(-1);
        txtNroCalle.setEnabled(false);
        txtPiso.setEnabled(false);
        txtDpto.setEnabled(false);
        cboZona.setEnabled(true);
        cboZona.setSelectedIndex(-1);
        txtNroCalle.setText("");
        txtPiso.setText("");
        txtDpto.setText("");
    }//GEN-LAST:event_rbtnZonaActionPerformed

    private void rbtnOperadoraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbtnOperadoraActionPerformed
        txtCaso.setEnabled(false);
        cboOperador.setEnabled(true);
        cboMotivo.setEnabled(false);
        cboOperador.setSelectedIndex(-1);
        cboMotivo.setSelectedIndex(-1);
        txtCaso.setText("");
    }//GEN-LAST:event_rbtnOperadoraActionPerformed

    private void rbtnMotivoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbtnMotivoActionPerformed
        txtCaso.setEnabled(false);
        cboOperador.setEnabled(false);
        cboMotivo.setEnabled(true);
        cboOperador.setSelectedIndex(-1);
        cboMotivo.setSelectedIndex(-1);
        txtCaso.setText("");
    }//GEN-LAST:event_rbtnMotivoActionPerformed

    private void rbtnNroCasoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbtnNroCasoActionPerformed
        txtCaso.setEnabled(true);
        cboOperador.setEnabled(false);
        cboMotivo.setEnabled(false);
        cboOperador.setSelectedIndex(-1);
        cboMotivo.setSelectedIndex(-1);
        txtCaso.setText("");
    }//GEN-LAST:event_rbtnNroCasoActionPerformed

    private void rbtnFechaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbtnFechaActionPerformed
        dtpFecha1.setEnabled(true);
        dtpFecha1.setDate(null);
        dtpFecha2.setEnabled(false);
        dtpFecha2.setDate(null);
        dtpFecha3.setEnabled(false);
        dtpFecha3.setDate(null);
    }//GEN-LAST:event_rbtnFechaActionPerformed

    private void rbtnPeriodoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbtnPeriodoActionPerformed
        dtpFecha1.setEnabled(false);
        dtpFecha1.setDate(null);
        dtpFecha2.setEnabled(true);
        dtpFecha2.setDate(null);
        dtpFecha3.setEnabled(true);
        dtpFecha3.setDate(null);
    }//GEN-LAST:event_rbtnPeriodoActionPerformed

    private void rbtnAbordajeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbtnAbordajeActionPerformed
        cboAbordaje.setEnabled(true);
        cboSustancia.setEnabled(false);
        cboViolencia.setEnabled(false);
        cboViolencia.setSelectedIndex(-1);
        cboSustancia.setSelectedIndex(-1);
        cboAbordaje.setSelectedIndex(-1);
    }//GEN-LAST:event_rbtnAbordajeActionPerformed

    private void rbtnSustanciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbtnSustanciaActionPerformed
        cboAbordaje.setEnabled(false);
        cboSustancia.setEnabled(true);
        cboViolencia.setEnabled(false);
        cboViolencia.setSelectedIndex(-1);
        cboSustancia.setSelectedIndex(-1);
        cboAbordaje.setSelectedIndex(-1);
    }//GEN-LAST:event_rbtnSustanciaActionPerformed

    private void rbtnViolenciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbtnViolenciaActionPerformed
        cboAbordaje.setEnabled(false);
        cboSustancia.setEnabled(false);
        cboViolencia.setEnabled(true);
        cboViolencia.setSelectedIndex(-1);
        cboSustancia.setSelectedIndex(-1);
        cboAbordaje.setSelectedIndex(-1);
    }//GEN-LAST:event_rbtnViolenciaActionPerformed

    private static boolean isNumeric(String cadena) {
        try {
            Long.parseLong(cadena);
            return true;
        } catch (NumberFormatException nfe) {
            return false;
        }
    }
    /**
     * @param args the command line arguments
     */
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnBuscar;
    private javax.swing.JButton btnCerrar;
    private javax.swing.JButton btnSeleccionar;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.ButtonGroup buttonGroup3;
    private javax.swing.ButtonGroup buttonGroup4;
    private javax.swing.ButtonGroup buttonGroup5;
    private javax.swing.JComboBox cboAbordaje;
    private javax.swing.JComboBox cboCalle;
    private javax.swing.JComboBox cboMotivo;
    private javax.swing.JComboBox cboOperador;
    private javax.swing.JComboBox cboSexo;
    private javax.swing.JComboBox cboSustancia;
    private javax.swing.JComboBox cboTipoBusqueda;
    private javax.swing.JComboBox cboViolencia;
    private javax.swing.JComboBox cboZona;
    private com.toedter.calendar.JDateChooser dtpFecha1;
    private com.toedter.calendar.JDateChooser dtpFecha2;
    private com.toedter.calendar.JDateChooser dtpFecha3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLayeredPane jLayeredPane1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTable1;
    private javax.swing.JPanel pnl1;
    private javax.swing.JPanel pnl2;
    private javax.swing.JPanel pnl3;
    private javax.swing.JPanel pnl4;
    private javax.swing.JPanel pnl5;
    private javax.swing.JRadioButton rbtnAbordaje;
    private javax.swing.JRadioButton rbtnCalle;
    private javax.swing.JRadioButton rbtnDni;
    private javax.swing.JRadioButton rbtnEdad;
    private javax.swing.JRadioButton rbtnFecha;
    private javax.swing.JRadioButton rbtnMotivo;
    private javax.swing.JRadioButton rbtnNombre;
    private javax.swing.JRadioButton rbtnNroCaso;
    private javax.swing.JRadioButton rbtnOperadora;
    private javax.swing.JRadioButton rbtnPeriodo;
    private javax.swing.JRadioButton rbtnSexo;
    private javax.swing.JRadioButton rbtnSustancia;
    private javax.swing.JRadioButton rbtnViolencia;
    private javax.swing.JRadioButton rbtnZona;
    private javax.swing.JTextField txtApellido;
    private javax.swing.JTextField txtCaso;
    private javax.swing.JTextField txtDni;
    private javax.swing.JTextField txtDpto;
    private javax.swing.JSpinner txtEdad;
    private javax.swing.JTextField txtNombre;
    private javax.swing.JTextField txtNroCalle;
    private javax.swing.JTextField txtPiso;
    // End of variables declaration//GEN-END:variables
}
